from django.db import models
from django.utils.translation import ugettext as _
from sorl.thumbnail.fields import ImageField
from pages.models import Page

class Image(models.Model):
    image_file = ImageField(_('image file'), upload_to='pages_images_upload/', blank=True)
    placeholder_name = models.TextField(_('placeholder_name'))
    page = models.ForeignKey(Page)
    
    def __unicode__(self):
        return _('%s on %s' % (self.placeholder_name, self.page))
